<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>学校简介</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<link rel="stylesheet" href="css/main.css">
	<style>
		.content_title {
			width: 90%;
			margin-bottom: 10px;
			height: 30px;
			text-align: center;
			margin-left: 5%;
			line-height: 30px;
			letter-spacing: 15px;
			font-size: 25px;
			font-weight: bold;
		}

		.introduce {
			width: 90%;
			font-size: 16px;
			line-height: 30px;
			margin-left: 5%;
			color: #454545;
			white-space: pre-wrap;
		}

		.introduce img {
			max-width: 90vw !important;
		}
	</style>
</head>

<body>

	<div id="container">
		<div class="contain">
			<div class="header">
				<div class="header_title">学校简介</div>
				<a onclick="history.back()">
					<img src="image/return.png" alt="" class="return">
				</a>
			</div>
			<div class=" header-after" id="vue-root">
				<div class="content_title" v-text="school.name"></div>
				<div class="img_box" v-if="school.pic">
					<img :src="getImg(school.pic)" class="content_img">
				</div>
				<div style="margin-left: 5%;">学校简介:</div>
				<div class="introduce" v-html="school.summary"></div>
				<div style="float: right;margin-right: 5%;">
					<div v-if="school.address">学校地址:<span v-text="school.address"></span></div>
					<div v-if="school.contactInfo">学校电话:<span v-text="school.contactInfo"></span></div>
				</div>
			</div>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>

	<script>

		(function () {
			var id = params().id;
			if (!id) {
				id = getPerson().schoolId;
				location.replace('?id=' + id);
				return;
			}

			var app = new Vue({
				el: '#vue-root',
				data: {
					school: {}
				},
				created: function () {
					axios.get('/api/school/' + id).then(function (res) {
						this.school = res.data;
					}.bind(this));
				},
				methods: {
					getImg: function (pic) {
						return '/static/' + this.school.id + '/school/' + pic;
					}
				}
			});
		})();

	</script>

</body>

</html>